using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CMS_GYM
{
    public partial class frmPublic : Form
    {
        public frmPublic()
        {
            InitializeComponent();
            lblTitle.Text = lblTitle.Text.ToUpper();
            this.KeyPreview = true;
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        //private void SelectNext(Control c)
        //{
        //    if (c.Focused)
        //    {
        //        Control skipControls = this.GetNextControl(c, true);
        //        do
        //        {
        //            while (skipControls is Button ||
        //                skipControls is GroupBox ||
        //                skipControls is Panel) skipControls = this.GetNextControl(skipControls, true);
        //            if (null != skipControls)
        //            {
        //                skipControls.Select();
        //                break;
        //            }
        //            else
        //                skipControls = this.Controls[0];
        //        } while (true);
        //        return;
        //    }
        //    foreach (Control childControl in c.Controls)
        //    {
        //        SelectNext(childControl);
        //    }
        //}
        protected override void OnKeyDown(KeyEventArgs e)
        {

            switch (e.KeyCode)
            {
                case Keys.Enter:
                    //SelectNext(this);
                    if(e.Modifiers == Keys.Control)
                    {
                        base.OnKeyDown(e);
                    }
                    else
                    {
                        SendKeys.Send("{TAB}");
                    }
                    break;
                default:
                    base.OnKeyDown(e);
                    break;
            }
        }
    }
}